{extend name="common:main" /}
{block name="cssjs"}
<script src="__PUBLIC__/static/js/admin/mystore.js?{$Think.config.html_v}"></script>
{/block}
{block name="content"}
{php}$orderClass=array($orderKey=>'_'.$sortBy);$orderSort=array($orderKey=>($sortBy=='asc'?'升序':'倒序'));{/php}
<div class="nav-tabs-custom">
	<ul class="nav nav-tabs">
    	<li class="active"><a href="{:url('Mystore/rule')}">采集规则</a></li>
    	<li><a href="{:url('Mystore/releaseApp')}">发布插件</a></li>
    	<li><a href="{:url('Mystore/funcApp')}">函数插件</a></li>
    	<li class="nav-tab-right">
	    	<div class="nav-check-update">
	    		<a href="javascript:;" id="check_update">检测更新</a>
	    		<input type="checkbox" id="auto_check" {:is_empty(g_sc_c('store_auto_check_rule'))?'':'checked="checked"'} value="1" title="刷新页面时自动检测" />
	    	</div>
    	</li>
	</ul>
	<div class="tab-content">
		<div class="tab-pane active">
		    <div class="table-responsive">
				<form id="form_list" method="post" ajax-submit="true" action="{:url('Mystore/ruleOp')}">
				{:html_usertoken()}
				<table id="list_table" class="table table-hover datatable">
					<thead>
						<tr>
							<th class="chk">{$Think.lang.select}</th>
							<th class="sorting{$orderClass['name']}" data-order="name" title="名称{$orderSort['name']}">名称</th>
							<th>模块</th>
							<th class="sorting{$orderClass['addtime']}" data-order="addtime" title="本地添加时间{$orderSort['addtime']}">本地添加</th>
							<th class="sorting{$orderClass['uptime']}" data-order="uptime" title="平台更新时间{$orderSort['uptime']}">平台更新</th>
							<th>平台</th>
							<th>{$Think.lang.op}</th>
						</tr>
					</thead>
					<tbody>
					{foreach name="ruleList" item="rule"}
						<tr data-rule-id="{$rule['id']}">
							<td class="chk"><input type="checkbox" name="ids[]" value="{$rule['id']}" /></td>
							<td><div class="name">{$rule['name']}</div></td>
							<td>{:lang('task_module_'.$rule['module'])}</td>
							<td>{:date('Y-m-d H:i',$rule['addtime'])}</td>
							<td>{:date('Y-m-d H:i',$rule['uptime'])}</td>
							<td>
								<a href="javascript:;" data-url="{$rule['_store_url']}" class="store-detail">{$rule['_is_provider']?'第三方':'官方'}</a>
							</td>
							<td><a href="javascript:;" url="{:url('Mystore/ruleOp?op=delete&id='.$rule['id'])}" class="delete">删除</a></td>
						</tr>
					{/foreach}
					</tbody>
					<tfoot>
						<tr>
							<td class="chk"><label><input type="checkbox" id="chkall" onclick="checkall(this,'ids[]')" />全部</label></td>
							<td><button type="button" class="btn btn-danger" id="deleteall">{$Think.lang.delete}</button></td>
							<td colspan="5" style="text-align:right;font-size:12px;">
								{if !empty($ruleList)}
								<p class="help-block">在 “编辑任务 &gt; 导入规则 &gt; 已下载规则” 中使用</p>
								{/if}
							</td>
						</tr>
		    			{if condition="!empty($pagenav)"}
						<tr>
							<td colspan="7">{$pagenav}</td>
						</tr>
						{/if}
					</tfoot>
				</table>
				</form>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
myStoreClass.init_rules();
</script>
{/block}